<%@page import="com.team.entity.Task"%>
<%@page import="com.team.entity.Goal"%>
<%@page import="com.team.entity.Project"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.team.entity.User" %>
 <%@ page import="com.team.util.Const" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>新建任务</title>
	<link rel="stylesheet" href="css/prettify.css" />
    <link rel="stylesheet" href="css/bootstrap.min.css" />
</head>
<body class="body">
<% 
	User user = (User)session.getAttribute(Const.SESSION_USER);
	Project project =(Project)session.getAttribute(Const.SESSION_PROJ); 
 %>
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a href="#" class="brand">凯盛项目管理系统</a>
				 <ul class="nav pull-right">
						<li><a class="nav pull-right" href="#">用户名： <%=user.getUsername() %></a></li>
				 </ul>
			</div>
		</div>
	</div>
  
  <div class="container">
		<div class="row">
			<div class="span3">
			<div class="well" style="padding: 8px 0;">
						<ul class="nav nav-list">
						  <li class="nav-header"><%=project.getProjName() %></li>
						  <li class="divider"></li>
						  <li ><a href="info.jspx?_m=select&projId=<%=project.getId() %>"><i class="icon-white icon-home"></i>最新动态</a></li>
						  <li  class="active"><a href="goal.jsp"><i class="icon-flag"></i>目标</a></li>
						  <li ><a href="docShare.jspx?_m=select&projId=<%=project.getId() %>"><i class="icon-folder-open"></i>资料库</a></li>
						  <li><a href="fileshare.jsp"><i class="icon-file"></i>文件共享</a></li>
						  <li><a href="newContact.jspx?_m=select&projId=<%=project.getId() %>"><i class="icon-user"></i>联系人</a></li>
						  <li><a href="newIdea.jspx?_m=select&id=<%=project.getId() %>"><i class="icon-fire"></i>想法</a></li>
						  <li ><a href="findBug.jsp"><i class="icon-warning-sign"></i>Bug</a></li>
						  <li><a href="projReset.jsp"><i class="icon-cog"></i>项目设置</a></li>
						</ul>
					</div>
				</div>
			
			
			<div class="span9">
			
			<%
				Goal goal = (Goal)session.getAttribute(Const.SESSION_SAVEGOAL);
				if(goal == null){
			 %>
			 <div style="color:red;">目标为空</div>
			 <%}else { %>
			<ul style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px" class="breadcrumb">
				<li class="active">
					<a href="javascript:;"><i class="icon-th"></i><%=goal.getGoalName() %></a>
				</li>
			</ul>
			<div class="wall">
				<p><%=goal.getContent() %></p>
				<div class="progress progress-danger">
					<div style="width: 60%;" class="bar">当前目标总进度完成60%</div>
				</div>
				<%} %>
				<div class="page-header">
					<a class="btn btn-success" href="newtask.jsp"><i class="icon-plus icon-white"></i>添加新任务</a>
					<a class="btn" href="task.jspx?_m=select&goalid=<%=goal.getId() %>"><i class="icon-plus icon-white"></i>显示该项目所有任务</a>
					
				</div>
				
				<%
					List<Task> list =(List<Task>)session.getAttribute(Const.SESSION_TASKS);
					Map<Task,User> map  = (Map<Task,User>)session.getAttribute(Const.SESSION_TASKSMAP);
					if(list == null){
				 %>
				 <div style="color:red;"></div>
				 <%}else {
				 for(Task task : list){
				  %>
				<dl>
        			<dt><i class="icon-bookmark"></i><a href="task.jspx?_m=edit&id=<%=task.getId() %>"><%=task.getTaskName() %></a>&nbsp;&nbsp;&nbsp;[<%=map.get(task).getUsername() %>]</dt>
        			<dd><%=task.getContent() %></dd>
        			
        			<div class="progress">
					  <div style="width:<%=task.getRate() %>;" class="bar"></div>
					</div>

      			</dl>
				<%}} %>
			</div>
			
		</div>
		
		</div>
  </div>
	
</body>
</html>